﻿using M;
using M.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MClient.Test
{
    internal class Updater
    {
        private static Updater Instance = new Updater();

        public static void Run()
        {
            UpdateMain();
        }

        public static void UpdateMain()
        {
            var db = DI.InsProvider.GetService<OneToOneContext>();
            var item = db!.Player
                .Include(x => x.Resume)
                .Single(x => x.Id == 2);

            item.Name= "更改name" + DateTime.Now.ToString("HHmmss");

           // item.Resume.Description = "更改Description" + DateTime.Now.ToString("HHmmss");

            db.SaveChanges();

            Console.WriteLine(item.Resume.Id);
        }
    }
}
